﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Common
{
    [ActiveRecord]
    public class PurchaseOrders : PersistentObjectWithGuid
    {
        #region 项目编号
        [Property]
        [ValidateIsUnique("数据库已经存在相同的项目编号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "项目编号超长！")]
        public virtual string ProjectCode
        {
            get
            {
                return projectCode;
            }
            set
            {
                projectCode = value;
            }
        }
        private string projectCode;
        #endregion

        #region 项目名称
        [Property]
        [ValidateNonEmpty, ValidateLength(0, 40, "项目名称超长！")]
        public virtual string ProjectName
        {
            get
            {
                return projectName;
            }
            set
            {
                projectName = value;
            }
        }
        private string projectName;
        #endregion

        #region 预算收入
        [Property]
        public virtual Decimal BudgetIncome
        {
            get
            {
                return budgetIncome;
            }
            set
            {
                budgetIncome = value;
            }
        }
        private Decimal budgetIncome;
        #endregion

        #region 预算成本
        [Property]
        public virtual Decimal BudgetCost
        {
            get
            {
                return budgetCost;
            }
            set
            {
                budgetCost = value;
            }
        }
        private Decimal budgetCost;
        #endregion

        #region 预算收入差额
        [Property]
        public virtual Decimal BudgetReceiptBalance
        {
            get
            {
                return budgetReceiptBalance;
            }
            set
            {
                budgetReceiptBalance = value;
            }
        }
        private Decimal budgetReceiptBalance;
        #endregion

        #region 预算成本差额
        [Property]
        public virtual Decimal BudgetCostBalance
        {
            get
            {
                return budgetCostBalance;
            }
            set
            {
                budgetCostBalance = value;
            }
        }
        private Decimal budgetCostBalance;
        #endregion

        #region 开工日期
        [Property]
        public virtual DateTime StartDate
        {
            get
            {
                return startDate;
            }
            set
            {
                startDate = value;
            }
        }
        private DateTime startDate;
        #endregion

        #region 完工日期
        [Property]
        public virtual DateTime EndDate
        {
            get
            {
                return endDate;
            }
            set
            {
                endDate = value;
            }
        }
        private DateTime endDate;
        #endregion

        #region 备注名称
        [Property]
        [ValidateNonEmpty, ValidateLength(0, 2000, "备注超长！")]
        public virtual string Remark
        {
            get
            {
                return remark;
            }
            set
            {
                remark = value;
            }
        }
        private string remark;
        #endregion
    }
}
